package ooday05;

/**
 * @author Pxl
 */
public class Demo1 {
    public static void main(String[] args) {

    }
}
class Card{
    private String cardId;
    private String cardPwd;
    private double balance;

    public boolean payMoney(double money){//支付金额
        if(balance>=money){
            balance -= money;
            return true;
        }else {
            System.out.println("余额不足");
            return false;
        }
    }

    public boolean checkPwd(String pwd){//检测密码
        if(pwd == cardPwd){
            System.out.println("密码正确");
            return true;
        }else {
            System.out.println("密码错误");
            return false;
        }
    }
}